package 力扣日常刷题.木22一月.第09天0117;

import java.util.ArrayList;
import java.util.List;

/**
 * @author 帅小伙
 * @date 2022/1/17
 * @description
 */
public class Demo10动态规划简单杨辉三角II {


    public List<Integer> getRow(int rowIndex) {
        ArrayList<Integer> row = new ArrayList<>();

        row.add(1);

        for (int i = 1; i <= rowIndex ; i++) {
            row.add(0);
            for (int j = i; j > 0 ; j--) {
                row.set(j,row.get(j)+row.get(j-1));
            }
        }
        return row;
    }
}
